package le.controller;

import le.entity.ActivityDO;
import le.model.ApiResult;
import le.service.UserService;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.Map;

/**
 * @author liangyongle
 * @date 2018/8/1 0001
 */
@RestController
@RequestMapping("User")
public class UserController {

    @Resource
    private UserService userService;

    @RequestMapping("/getUser")
    public ApiResult getUser(){
        ActivityDO list =  userService.getActivity();
        return ApiResult.ok(list);
    }

    @RequestMapping("/activity")
    public ApiResult getActivity(){
        Map<String,Object> result = userService.getActivityInfo();
        return ApiResult.ok(result);
    }

}
